<!DOCTYPE html>
<html>
<head>
	<title>index</title>
	<meta http-equiv="content-type" content="txt/html; charset=utf-8" />
	<script typet="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>


		<p id="123">拉勾网</p>
	<button id="btn_warrnup">初始化</button>
    <br>
    <br>
    <button id="btm_order">下单</button>
    <br>
    <br>
    <button id="btn_payall">批量支付</button>
<br>
<br>
    <button id="btn_redis">查看库存</button>
</body>

<script text="text/javascript">
	
	$("#btm_order").click(function(){
        $.ajax({
            type: "get",
            data: "",
            url: "/secondKill",
            success: function(data){
            	if(data == "buy success"){
					alert("buy success")
            	}
            	if(data == "sold out"){
            		alert("sorry,sold out")
            	}
            
            
            },
            error:function(){
                alert("something worry");
            }
        });
     });

    $("#btn_warrnup").click(function(){
        $.ajax({
            type: "get",
            data: "",
            url: "/warrnup",
            success: function(data){
                if(data == "warrnup success"){
                    alert("warrnup success")
                }
            
            },
            error:function(){
                alert("something worry");
            }
        });
     });

    $("#btn_payall").click(function(){
        $.ajax({
            type: "get",
            data: "",
            url: "/paybill",
            success: function(data){
                if(data == "pay success"){
                    alert("pay success")
                }
            
            },
            error:function(){
                alert("something worry");
            }
        });
     });

    $("#btn_redis").click(function(){
        $.ajax({
            type: "get",
            data: "",
            url: "/redisacount",
            success: function(data){
                alert(data)
            
            },
            error:function(){
                alert("something worry");
            }
        });
     });


</script>

</html>